#pragma once

#include <Windows.h>
#include "DirectX.h"
#include "dxinput.h"
#include "Sprite.h"
#include "ResourceManager.h"
#include "Collision.h"

class Game
{
public:
	Game(void);
	Game(HINSTANCE hInstance, LPCSTR GameName, LPSTR lpCmdLine, int nShowCmd, int FPS, int ScreenWidth, int ScreenHeight);
	~Game(void);

	int InitWindow();
	int GameInit();

	void GameLoop();
	void GameEnd();
	virtual void GameUpdate();
	void GameRender();

	void ProcessKeyboard();

	virtual void LoadResource() = 0;
	virtual void RenderFrame() = 0;
	virtual void OnKeyDown(int KeyCode)=0;
	virtual void OnKeyUp(int KeyCode)=0;


protected:
	static LRESULT CALLBACK WinProc(HWND hWnd,UINT msg,WPARAM wParam, LPARAM lParam);

	HINSTANCE _hInstance;
	HWND _hWnd;
	LPSTR _lpCmdLine;
	int _nShowCmd;
	
	LPDIRECT3DSURFACE9 _backbuffer,_background;
	Sprite* _sprite;
	LPCSTR _gameName;

	CResourceManager *_rm;

	//test

	int _FPS;
	int _screenWidth;
	int _screenHeight;

	int _x,_y;
	int _vx;

	DirectX *_directX;
	DXinput *_dInput;

	Collision _coll;

};

